<template>
    <div>
        <view class="cu-bar bg-white solid-bottom margin-top">
            <view class="action">
                <text class="cuIcon-title text-orange"></text>
                <text class="text-black">{{notice.title}}</text>
            </view>
        </view>
        <div class="padding-xl bg-white">
            <u-parse :content="notice.content"></u-parse>
        </div>

    </div>
</template>

<script>

import uParse from '@/components/u-parse/u-parse.vue'

const app = getApp();
export default {
    components: {
        uParse
    },
    data() {
        return {
            notice_id: -1,
            notice:{
                "notice_id": -1,
                "content":'',
                "uid": -1,
                "association_id": -1,
                "token": '',
                "title": "",
                "create_time": ""
            }
        }
    },
    onLoad(options) {
        this.notice_id = options.id;
        this.requestNotice();
    },
    methods: {
        requestNotice() {
            this.$myFunction.getData(app.globalData.ApiUrl + 'api/Android/showNoticeDetail', {
                notice_id: this.notice_id,
            }).then(res => {

                console.log(res);

                if (res.code == 1) {
                    this.notice = res.data;
                }else{
                    uni.showToast({
                        title: res.msg,
                        icon: 'none'
                    })
                }
            });
        },
    }
}
</script>

<style>
@import url("/components/u-parse/u-parse.css");
</style>
